package Impl;

import Bean.BeanPlace;
import Dao.PlaceDao;
import Service.PlaceService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;

@Service("PlaceServiceImpl")
public class PlaceServiceImpl implements PlaceService {
	@Resource(name="PlaceDAO")
	PlaceDao placeDao;

	public PlaceDao getPlaceDao() {
		return placeDao;
	}

	public void setPlaceDao(PlaceDao placeDao) {
		this.placeDao = placeDao;
	}

	@Override
	public ArrayList<BeanPlace> getPlaces() throws Exception {
		return placeDao.getPlaces();
	}

	@Override
	public ArrayList<BeanPlace> getPlaceByKeyword(String keyword) throws Exception {
		return placeDao.getPlaceByKeyword(keyword);
	}

	@Override
	public void placeupdate(int placeid, String placename, String place_photo, String place_introduction) throws Exception {
		placeDao.placeupdate(placeid,placename,place_photo,place_introduction);
	}

	@Override
	public void placeadd(String placename, String place_photo, String place_introduction) throws Exception {
		placeDao.placeadd(placename,place_photo,place_introduction);
	}

	@Override
	public void placedelete(int placeid) throws Exception {
		placeDao.placedelete(placeid);
	}
}
